home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!news
- From: ark@research.att.com (Andrew Koenig)
- Newsgroups: comp.std.c++
- Subject: Re: RTTI implementation...
- Date: 08 Jan 1996 23:02:07 GMT
- Organization: AT&T Bell Laboratories, Murray Hill NJ
- Approved: austern@mti.sgi.com
- Message-ID: <DKrnsG.7J7@research.att.com>
- References: <4ciauq$2e1@trojan.neta.com>
- NNTP-Posting-Host: isolde.mti.sgi.com
- Keywords: RTTI
-
-
- In article <4ciauq$2e1@trojan.neta.com> jgreen@amex-trs.com writes:
-
- > It seems that RTTI requires a compile time flag to be activated. When
- > activated the code seems to bloat whether you actualy use the feature in the
- > specific peice of code or not. From what I have learned this overhead is due
- > to extra work done when the object is constructed (A pointer to this with a
- > string representation of the class is added to a table). This overhead does
- > not make RTTI a good addition to C++ but more of a optional addition to those
- > who want it (this is how it is implemented now). Also are the addition of key
- > words which is not a biggy in this case given the key word names.
-
- There's nothing I can think of in the language that requires
- it to be implemented that way. It is intended to be possible
- to implement RTTI by adding an extra field to the virtual function
- table, which means there is a small amount of space overhead per
- class (not per object) and no time overhead except for the places
- in the program where RTTI is actually used. I can see no reason why
- any extra work should have to be done when objects are constructed.
- --
- --Andrew Koenig
- ark@research.att.com
-
-